import { Vue } from 'vue-property-decorator'
import { ComponentModel } from '..'

export declare class ITgComponent extends Vue {
  buildDOMKey(cm: ComponentModel, index: number): string
  defaultRef(): string
  ref(key: string): Vue | Element | Vue[] | Element[]
  refs(): { [key: string]: Vue | Element | Vue[] | Element[] }
}

export declare class IElFormPackage extends ITgComponent {
  getModelValue(name: string): any
  getModel(): any
  clearValidate(): void
  validateForm(): Promise<boolean>
  clearForm(): void
  resetForm(): void
}

export declare class IElTreePackage extends ITgComponent {
  filterNode(queryString: any): void
  reloadNode(parent?: any): void
}

export declare class ITgForm extends ITgComponent {
  handleFormInput(model: any): void
  initForm(operate: 'add' | 'edit' | 'view', params?: any, dynamicModel?: any): void
  saveModel(): void
  getModel(): any
  clearValidate(): void
  validateForm(): Promise<boolean>
  clearForm(): void
  resetForm(): void
}

export declare class ITgFormBasic extends ITgForm {
}

export declare class ITgFormBasicDialog extends ITgForm {
  showDialog(): void
  hideDialog(): void
}

export declare class ITgFormBasicPopover extends ITgForm {
  showPopover(): void
  hidePopover(): void
}

export declare class ITgTable extends ITgComponent {
  initTable(loadData?: boolean, frozenParams?: any): void
  getQuerier(): any
  showSearcher(): void
  hideSearcher(): void
  doSearch(): void
  clearSearcher(): void
  getSelectedRows(): any[]
}

export declare class ITgTableBasic extends ITgTable {
}

export declare class ITgTableBasicDialog extends ITgTable {
  showDialog(): void
  hideDialog(): void
}

export declare class ITgTableCategory extends ITgTable {
}

export declare class ITgTreeBasic extends IElTreePackage {
  initTree(loadData?: boolean, frozenParams?: any): void
  getQuerier(): any
}
